﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using XiaoMan.BLL;
using XiaoMan.Model.Models;
using XiaoMan.Service;

namespace XiaoMan.API.Controllers
{
    [RoutePrefix("api/forumtopicback")]
    public class ForumTopicBackController : ApiBaseController
    {
        Forum_Topic_BackService ftbs = new Forum_Topic_BackService();

        /// <summary>
        /// 根据帖子查询直接评论
        /// </summary>
        /// <returns></returns>
        [Route("getdirectforumtopicback")]
        [HttpGet]
        public IHttpActionResult getDirectForumTopicBack(int? topicID, int? pageindex)
        {
            List<Forum_Topic_Back> directForumTopicBackInfoList = ftbs.GetDirectForumTopicBack(topicID.Value, pageindex.Value);
            return ApiSuccess(directForumTopicBackInfoList);
        }

        /// <summary>
        /// 根据帖子查询对评论的所有回复
        /// </summary>
        /// <param name="topicID"></param>
        /// <param name="backID"></param>
        /// <returns></returns>
        [Route("getrestoreforumtopicback")]
        [HttpGet]
        public IHttpActionResult getRestoreForumTopicBack(int? topicID, int? backID)
        {
            List<Forum_Topic_Back> restoreForumTopicBackInfoList = ftbs.GetRestoreForumTopicBack(topicID.Value, backID.Value);
            return ApiSuccess(restoreForumTopicBackInfoList);
        }
    }
}